package org.mobile.database.statements;

public class Statements {

	public static final String SELECT_USER = "Select * from user where login=?";
	public static final String SELECT_USER_BY_ID = "Select * from user where userID=?";
	public static final String INSERT_USER = "Insert into user(login, password, name, surname, type, address, style) values(?, ?, ?, ?, ?, ?, ?)";
	public static final String SELECT_ALL_USERS = "Select userID, login, name, surname, type, address from User";
	public static final String UPDATE_USER = "Update user set name= ?, surname= ?, address= ? where userID= ?";
	public static final String UPDATE_USER_PASS = "Update user set password= ? where userID= ?";
	public static final String UPDATE_PROFILE= "Update user set style= ? where userID= ?";
	public static final String REMOVE_USER = "Delete from user where userID= ?";

	public static final String SELECT_PHONE = "Select * from phone where phoneID= ?";
	public static final String ADD_PHONE = "Insert into phone(model, price, hardiness, camera, height, width, depth, weight, colors, resolution, screen_size, talk_time2g, talk_time3g, stand_by2g, stand_by3g, build_in_mem, ram, max_card_size, nr_of_app, proc_clock, release_date, popularity, hsdpaitd, gorillaglass, design, autofocus) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
	public static final String REMOVE_PHONE = "Delete from phone where phoneID= ?";
	public static final String UPDATE_PHONE= "Update phone set model= ?, price= ?, hardiness= ?, camera= ?, height= ?, width= ?, depth= ?, weight= ?, colors= ?, resolution= ?, screen_size= ?, talk_time2g= ?, talk_time3g= ?, stand_by2g= ?, stand_by3g= ?, build_in_mem= ?, ram= ?, max_card_size= ?, nr_of_app= ?, proc_clock= ?, release_date= ?, popularity= ?, hsdpaitd= ?, gorillaglass= ?, design= ?, autofocus= ? where model= ?";   
	public static final String SELECT_PHONE_BY_ORDER= "Select phone.* from order_phone inner join phone on order_phone.phoneID= phone.phoneID where orderID=?";
	public static final String SELECT_ALL_PHONES ="Select * from phone";
	public static final String SEARCH_PHONE= "Select * from phone where price<=? and screen_size=? and ram=? and proc_clock=? and nr_of_app=? and autofocus=? and gorillaglass=?";
	
	public static final String SELECT_ORDER = "Select order_.* from user_order inner join order_ on user_order.orderID= order_.orderID where userID=?";
	public static final String REMOVE_ORDER= "Delete from order_ where orderID= ?";
	public static final String REMOVE_ORDER_BY_USER_ID= "Delete from order_ where orderID in(Select orderID from user_order where userID=?)";
	public static final String SELECT_ALL_ORDERS= "Select * from order_";
	public static final String UPDATE_ORDER_STATUS= "Update order_ set status= ? where orderID= ?";
	public static final String ADD_ORDER= "Insert into order_(date, status) values(?, ?)";
	public static final String ADD_USER_ORDER= "Insert into user_order(userID, orderID) values(?, ?)";
	public static final String ADD_ORDER_PHONE= "Insert into order_phone(orderID, phoneID) values(?, ?)";
	public static final String MAX_ID= "Select max(orderID) as maxID from order_";
}
